/**
 *  created by lllwx
 *  date: 2022/1/20
 *  time: 3:19 下午
 *  version: 1.0
 *  desc: 自动注册全局组件
 */
import Vue from 'vue';

export const registerComponents = () => {
  const componentsContext = require.context('./', true, /index.(vue|jsx|tsx)$/);
  componentsContext.keys().forEach((component) => {
    // 组件信息
    const componentConfig = componentsContext(component).default;
    Vue.component(componentConfig.name, componentConfig);
  });
};
